﻿<%@ WebHandler Language="C#" Class="GetGongde" %>

using System;
using System.Web;
using System.Data;
using Dos.Model;

public class GetGongde : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        CategoryActions cate = new CategoryActions();
        int cid = (int)cate.GetList("功德").Rows[0]["ID"];
        DataTable dt = DB.Context.From<temple_Contents>().Select(s => new { s.ID, s.Title, s.Attachment, s.CategoryID, s.AddTime, s.SortID, s.Photo }).Where(w => w.CategoryID == cid && w.IsDel == false && w.ID != -1).OrderBy(od => od.SortID).Top(6).ToDataTable();
        context.Response.Write(JsonHelper.GetJson(dt));
    }

    public bool IsReusable
    {
        get { return false; }
    }

}